<%--
*
* 描述：用户表BASIC_USER的list文件列表
* 
* @author tch  
*
--%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="g" uri="/fishergrid-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <title><s:property value="operate"/>发送消息</title>
	<%@include file="/share/header.jsp"%>
	<s:head/>	
	<g:header theme="${sessionScope.skinCon.gridSkin}"/>	
  </head>
  <body>
	<script type="text/javascript">
		function onDoGetSelectUser(){
			var users=fisherGetSelectedValues();
			if(users.length==0){
				//请选择接收人
				top.MyWindow.tips({
					content : '未选择消息接收人！',
					title : '错误框',
					type : 'error',
					container : top					
				});	
				return;
			}
			//接收人上限为250个用户
			//var usersLength=users.length;
			//if(usersLength>250){
				users=users.slice(0,250);
			//}
			
			var options={
				title:'【发送消息】',
				url:'<s:url action='new' namespace='/system/message'/>?domain.receiver='+users.toString(),
				source : window,
				buttons:[top.MyWindow.OkClose,top.MyWindow.OkAdd,top.MyWindow.Cancel],
				multiplewidth:1,
				multipleheight:1,
				tipstitle:'',
				tipscontent:''
			};
			top.MyWindow.open(options);
		}					
		function onDoSendMessage(tdDiv,pid){
			var userObj=pid.split(":");
			//帐号
			var account=userObj[0];
			//名称
			var name=userObj[1];
			var options={
				title:'【发送消息】',
				url:'<s:url action='new' namespace='/system/message'/>?domain.receiver='+account+"&reciveNames="+name,
				source : window,
				buttons:[top.MyWindow.OkClose,top.MyWindow.OkAdd,top.MyWindow.Cancel],
				multiplewidth:1,
				multipleheight:1,
				tipstitle:'',
				tipscontent:''
			};
			var edithtml='<a href="javascript:void(0);" title="发送">发送</a>';
			$(tdDiv).html("");//去除原有的内容
			$(tdDiv).append($(edithtml).click(function(){//添加链接
											top.MyWindow.open(options);
										})
							);
		}	
	</script>  
  	<s:actionerror/>
  	<g:grid title="用户列表" name="/system/message/user.fisher.xml" >
  		<g:select/>
  		<g:button name="批量发送" styleClass="fisherAdd" onclick="onDoGetSelectUser"/>
  		<g:separator/>   				
  		<g:query/>
  	</g:grid>
  </body>
</html>
